Skip to main content

Cloud_Based_SWMM_Web_API

Table Of Contents

 [[#Document]] 

 [[#Vision Summary]]  

 [[#Functionality]]

     [[#Feature Summary]]

 [[#External Dependencies]]

 [[#Additional Requirements]] 

Document

Created By: Benjamin Bedinghaus
Created On: 12/16/2013

Revised By: Benjamin Bedinghaus
Revised On: 12/16/2013

Vision Summary

Build a RESTful Web API that allows any platform interact with the Cloud Based SWMM Modeling results and also Cloud Based SWMM Sensor Results. Added WCF application name to constants APPLICATION_SWMMSWCF added.

Design Goals

Create an intuitive RESTful Web API using WCF Service that will be housed within the Asp.net web role within windows azure. All table storage names are stored in GQCLibrary.Constants RUNS_TABLE

Error Handling

This is partially implemented storing any exceptions that are thrown upon invoking the results

Functionality

Feature Summary

This section will list all of the different calls available to the Web API we've currently defined. They will include the Relative URL template, detailed descriptions of each of the parameters and what they're used for, and a definition of the results.

  • /System/Run/Latest

  • Parameters

  • N/A

  • Results

  • This function will return the data for the most recent run executed and is marked as IsRunComplete as True. This run is the one that is marked as complete.

  • ModelRunData - Serialized into json

  • RunTime - The local time the run was kicked off at

  • String ISO8061 (e.g. 2012-01-01T00:00:00-05:00)

  • InputFile - The SWMM5 input file that was used to run the model

  • String

  • IsRunComplete - True if the run is complete false if it didnt finish running and store the data.

  • Boolean

  • StartTime - The model Start time in real time

  • String ISO 8061 same format as RunTime

  • EndTime - The model end time in real time

  • String ISO 8061 same format as RunTime

  • ReportingTimestep - The time in minutes between each reporting value

  • Integer

  • /System/Summary/{pRunDateTime}/{pStep}

  • Parameters

  • pRunDateTime - A string value that is ISO 8061 that has all special characters serialzed as their spelling. For example the "-" is encoded as minus and the ":" is encoded as colon.

  • pStep - an integer value pertaining to the number of minutes into the simulation that is running

  • Results

  • This gives the summary results for the whole system described in the next section serialized as json for the simulation run at the pRunDateTime and the pStep.

  • SWMM5Results

  • Precipitation - This is a double value of the total precipitation recorded for that time step

  • RunOff - This is a double value of the runoff recorded for the time step

  • DWInflow - This is the dry weather inflow recorded at this time step

  • Nodes - Set to null to reduce json size

  • Links - Set to null to reduce json size

  • Subcatchments - Set to null to reduce json size

  • /System/Nodes/{pRunDateTime}/{pStep}

  • Parameters

  • pRunDateTime - A string value that is ISO 8061 that has all special characters serialzed as their spelling. For example the "-" is encoded as minus and the ":" is encoded as colon.

  • pStep - an integer value pertaining to the number of minutes into the simulation that is running

  • Results

  • Returns in json a list of SWMMNodeResult that has one entry for every node in the system

  • SWMMNodeResult

  • Depth - A double value for the depth in feet of the water at that step

  • Head - Head value as a double for the desired step

  • Volume - Double value of the volume at the desired step

  • Lateral Inflow - double value for the lateral inflow at the step

  • Total Inflow - total inflow for the system at that node and that step

  • Flooding - Double value of any flooding at that node and step.

  • Values - a double array of the values listed before this that is six long and the same order as listed here.

  • /System/Nodes/{pNodeIndex}/{pRunDateTime}/{pStep}

  • Parameters

  • pRunDateTime - A string value that is ISO 8061 that has all special characters serialzed as their spelling. For example the "-" is encoded as minus and the ":" is encoded as colon.

  • pStep - an integer value pertaining to the number of minutes into the simulation that is running

  • pNodeIndex - The index value of the node that the user wants a specific node result for

  • Results

  • This function was designed to reduce the load sent down the wire from the /System/Nodes/{pRunDateTime}/{pStep} method by sending down the results for one Node by specifying the index and sending far less data down the wire

  • SWMMNodeResult

  • Depth - A double value for the depth in feet of the water at that step

  • Head - Head value as a double for the desired step

  • Volume - Double value of the volume at the desired step

  • Lateral Inflow - double value for the lateral inflow at the step

  • Total Inflow - total inflow for the system at that node and that step

  • Flooding - Double value of any flooding at that node and step.

  • Values - a double array of the values listed before this that is six long and the same order as listed here.

  • /System/Links/{pRunDateTime}/{pStep}

  • Parameters

  • pRunDateTime - A string value that is ISO 8061 that has all special characters serialzed as their spelling. For example the "-" is encoded as minus and the ":" is encoded as colon.

  • pStep - an integer value pertaining to the number of minutes into the simulation that is running

  • Long section Profile

  • Create a long section profile for set of conduits along the path. (Need to refer visual display from PCSWMM, EPA SWMM, & EmNet)

  • · Create Long section group and store it in input file? for eg: saving main trunk line group

External Dependencies

Rainfall storage requires the following inputs to function properly:

  1. The location in latitude and longitude

  2.  latitude=39.11 longitude=-84.50 which is 1237 Elsinore Avenue, Cincinnati, OH 45202

  3. NOAA rain service website

  4. http://graphical.weather.gov/xml/sample_products/browser_interface/ndfdXMLclient.php?whichClient=NDFDgen&lat=39.1065&lon=-84.5039&product=time-series&begin=2004-01-01T00%3A00%3A00&end=2016-07-30T00%3A00%3A00&Unit=e&precipa_r=precipa_r 

  1. Rainfall data from Lunken Airport 

Additional Requirements

 Visual Studio 2010 AZURE SDK 2.1 
MVC 4 Project Template
Razor as View Engine